import api from '../../../fetch/api'

export default {
    data() {
        return {
            bigImgPath: ''
        }
    },
    created() {
        this.getItemList();
    },
    methods: {
        getList() {
            this.getItemList(this.searchParams);
        },
        PlatformReliefModal_open(index) {
            let self = this;
            console.log('PlatformReliefModal_open', index, this.tbodysInfo)
            self.PlatformReliefModalData.couponList = this.tbodysInfo[index].couponList;
            self.PlatformReliefModalData.topBillCode = this.tbodysInfo[index].topBillCode;
            self.PlatformReliefModalData.couponValue = this.tbodysInfo[index].platformRelief;
            this.toOpenModal('PlatformReliefModal');
        },
        OnlinePayValueModal_open(index) {
            let self = this;
            console.log('OnlinePayValueModal_open', index)
            self.OnlinePayValueModalData.list = this.tbodysInfo[index].detailList;
            self.OnlinePayValueModalData.topBillCode = this.tbodysInfo[index].topBillCode;
            self.OnlinePayValueModalData.onlinePayValue = this.tbodysInfo[index].onlinePayValue;
            this.toOpenModal('OnlinePayValueModal');
        },
        //获取列表
        getItemList(aparams) {
            let self = this,
                params = {
                    page: this.pageNumber,
                    rp: this.pageSize
                };
            params = $.extend({}, params, aparams);
            // API.coupon.GetTraderListData(params)
            api.fetchGet('/share/listWater.do', params)
                .then(res => {
                    console.log('getListResult', res)
                    let data = res.data,
                        list = data.rows;
                    self.tbodysInfo = list;
                    self.total = data.total;
                }, err => { })
        },
        exportData() {
            let self = this;
            let params = {
            };
            params = $.extend({}, params, this.searchParams);
            self.showDialog("确认导出该报表?", '', function () {
                self.toExportAsync('/share/exportWater.do', params)
            })
        }
    },
    filters: {
        payType: function (value) {

            switch (value) {
                case 0:
                    return "微信支付"
                    break;
                case 1:
                    return "支付宝支付"
                    break;
                case 2:
                    return "余额支付"
                    break;
                case 3:
                    return "银联支付"
                    break;
                default:
                    break;

            }
        },
    }
}